package com.naiterui.ehp.bs.recommend.repository.mysql;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Repository;

import com.naiterui.common.repository.core.BaseJpaRepository;
import com.naiterui.ehp.bs.recommend.bean.CommonPrescription;

/**
 * 常用处方
 *
 * @author yangfuya
 */
@Repository
public interface ICommonPrescriptionRepository extends BaseJpaRepository<CommonPrescription, Long> {

    /**
     * 根据医生Id和处方名称查询
     *
     * @param doctorId
     * @param name
     * @param delFlag
     * @return
     */
    List<CommonPrescription> findByDoctorIdAndNameAndDelFlag(Long doctorId, String name, Integer delFlag);

    /**
     * 分页获取该医生的常用处方
     * 
     * @param doctorId
     * @param pageable
     * @param delFlag
     * @return
     */
    Page<CommonPrescription> findByDoctorIdAndDelFlag(Long doctorId, Pageable pageable, Integer delFlag);

    /**
     * 根据医生id和id获取
     * 
     * @param id
     * @param doctorId
     * @return
     */
    CommonPrescription findByIdAndDoctorId(Long id, Long doctorId);

}